package com.ssh.demo.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @ClassName NettyConfig
 * @Description TODO
 * @Author ssh
 * @Date 2021/4/12 10:53
 */
@Component
@ConfigurationProperties(prefix = "tcp")
@Setter
@Getter
public class NettyConfig {

    /**
     * tcp服务端口
     */
    private Integer tcpPort = 10001;

    /**
     * udp服务端口
     */
    private Integer udpPort = 10002;

    // ====\/ for netty

    private Integer masterSize = 1;//主线程数量
    private Integer slaveSize = 10;//子线程数量

    // ====\/ for both

    private Boolean tcpNoDelay = true;//小包模式
    private Boolean keepAlive = true;//心跳
    private Boolean broadcast = true;//广播

    /**
     * 是否启用
     */
    private Boolean enabled = true;
}
